from django.db import models

class Drug(models.Model):
    name = models.CharField(max_length=255)  # 药品名称
    formula = models.CharField(max_length=255)  # 化学式
    structure = models.TextField()  # 化学结构式（可以存储图像链接或化学结构的描述）

    def __str__(self):
        return self.name




class Download(models.Model):
    name = models.CharField(max_length=200)
    path = models.CharField(max_length=500)
    
    class Meta:
        db_table = 'bj_download'
        
    def __str__(self):
        return self.name


class Data(models.Model):
    id = models.AutoField(primary_key=True)
    # emnpd_id = models.CharField(max_length=50)
    # compound_cid = models.CharField(max_length=50)
    # mf = models.CharField(max_length=100)
    # mw = models.FloatField()
    # iupac_name = models.CharField(max_length=500)
    # smiles = models.TextField()
    # inchikey = models.CharField(max_length=100)
    # inchi = models.TextField()
    # similarity = models.FloatField()
    
    class Meta:
        db_table = 'bj_data'
        
    def __str__(self):
        return self.emnpd_id